<?php
return [
    'bootstrap' => [
        'queue', // The component registers its own console commands
        'mqueue' // rabbitMQ
    ],
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        // redis队列
        'queue' => [
            'class' => \yii\queue\redis\Queue::class,
            'as log' => \yii\queue\LogBehavior::class,
            'redis' => 'redis', // Redis connection component or its config
            'channel' => 'queue', // Queue channel key
        ],
        'elasticsearch' => [
            'class' => 'yii\elasticsearch\Connection',
            'autodetectCluster' => false,
            'nodes' => [
                [
                    'http_address' => '172.18.0.1:9200'
                ]
                // configure more hosts if you have a cluster
            ],
            'auth' => ['username'=>"elastic", 'password'=>'aniuaniu'],
            // set autodetectCluster to false if you don't want to auto detect nodes
            // 'autodetectCluster' => false,
            'dslVersion' => 7 // default is 5
        ],
        // rabbitmq消息队列
        'mqueue' => [
            'class' => \yii\queue\amqp\Queue::class,
            'host' => '192.168.2.46',
            'port' => 5672,
            'user' => 'myuser',
            'password' => 'mypass',
            'queueName' => 'queue',
        ],
    ],
];
